#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Mikan VMware ESXi WebAPI Module

Mikan Python Web Framework
"""

__author__ = "K.Sonohara"
__status__ = "develop"
__version__ = "0.0.0_9"
__date__    = "2013/03/10"
__license__ = 'LGPL'

# ------------------------------------------------------------
## Import Section
# ------------------------------------------------------------
# Python

# VMware ESXi
from pysphere import VIServer

# Mikan

# ------------------------------------------------------------
## Variable Section
# ------------------------------------------------------------

# ------------------------------------------------------------
## Function Section
# ------------------------------------------------------------

def info_esxi(host, username, password):
	server = VIServer()
	try:
		server.connect(host, username, password)
		return server
	except:
		return None

	return server

def info_esxi_vm(server, path):
	try:
		return server.get_vm_by_path(path)
	except:
		return None

# ------------------------------------------------------------
## Class Section
# ------------------------------------------------------------

# ------------------------------------------------------------
## Main Section
# ------------------------------------------------------------

# ------------------------------------------------------------
